package demo1;

abstract class Shape {
    public abstract void draw();
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆圈");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画❀");
    }
}

abstract class Person {
    public String name;
    public int age;

    public Person(String name,int age) {
        this.name = name;
        this.age = age;
        }
}

class Student extends Person {
    public Student() {
        super("zhangsan",10);
    }
}

public class Test {
    public static void func(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        func(new Flower());
        func(new Cycle());
        func(new Rect());
    }
}
